#include "HashTable.h"

namespace wk
{

    template <typename K, class HashKey = HashFunc<K>>
    class unordered_set
    {
        struct SetOfKey
        {
            const K &operator()(const K &kv)
            {
                return kv;
            }
        };

        using iterator = typename hash_bucket::HashTable<K, K, HashKey, SetOfKey>::Iterator;
        using const_iterator = typename hash_bucket::HashTable<K, K, HashKey, SetOfKey>::ConstIterator;

    public:
        std::pair<iterator, bool> insert(const K &kv)
        {
            return unordered_set.Insert(kv);
        }

        bool erase(const K &kv)
        {
            return unordered_set.Erase(kv);
        }

        iterator find(const K &kv)
        {
            return unordered_set.Find(kv);
        }

        iterator begin()
        {
            return unordered_set.Begin();
        }
        iterator end()
        {
            return unordered_set.End();
        }
        const_iterator begin() const
        {
            return unordered_set.Begin();
        }
        const_iterator end() const
        {
            return unordered_set.End();
        }

    private:
        hash_bucket::HashTable<K, K, HashKey, SetOfKey> unordered_set;
    };
}